home *** CD-ROM | disk | FTP | other *** search
/ Amnesia 8 / Amnesia - Issue 08 (1992-05-31)(Eclipse).adf / text / Article3 < prev    next >
Text File  |  1992-05-31  |  5KB  |  129 lines

  1. ; Here's a nice simple piece of code supplied by Gazzer which you can assemble 
  2. ; with DevPac.And maybe even learn something,take it away Gazz....
  3. ; Just load the file ARTICLE 3 from the TEXT Directory on this disk. 
  4. ; You can Find the Macro File in the TEXT directory on this disk.....
  5.  
  6.  ***************************************************************************
  7. *                                                                           *
  8. *                          SET UP A SCREEN  WITH A COPPER BAR               *
  9. *  Start Date : 21/5/92             (FOR Green-Beret)                       *
  10. * Last Update : 21/5/92               (And Amnesia)                         *
  11. *                               Code : Gazzer of ECLIPSE                    *
  12. *                                                                           *
  13.  ***************************************************************************
  14.  
  15. ; Include the macros
  16.  
  17.         Incdir  Df0:            ; Where to look for files
  18.         Include Macro           ; The Macros
  19.  
  20. ; And a few Equates.
  21.  
  22. screenwidth:    equ     40      ; Bytes (320 pixels)
  23. screenheight:   equ     256     ; Lines
  24. screenplanes:   equ     1       ; Number of Bitplanes
  25. screensize:     equ     screenwidth*screenheight      ; size of screen
  26.  
  27. ****************************************************************************
  28.  
  29. ; Don't forget to use chip ram
  30.  
  31.         CHIP
  32.  
  33. ****************************************************************************
  34.  
  35. ; Kill the operating system for good measure
  36.  
  37.         KILL
  38.  
  39. ****************************************************************************
  40.  
  41. ; Load custom and set up copper list
  42.  
  43.         Lea     Custom,A5               ; Get Custom Address ($dff000)
  44.         Move.l  #Copper,Cop1lch(a5)     ; Insert as system Copperlist
  45.  
  46. ****************************************************************************
  47.  
  48. ; Initialize Bitplanes
  49.  
  50.         ALLOC   10240,Memory,Screen     ; Allocate memory, 40w x 256 x 1 planes
  51.  
  52.         Move.l  Screen,D0               ; Screen Data Address
  53.         PLANEON D0,plane1l+2,plane1h+2  ; Set up Bitplane Pointers
  54.  
  55. ****************************************************************************
  56.  
  57. ; Main routine here
  58.  
  59. Mouse
  60.         POS                             ; Get in sync with vertical blank
  61.  
  62.         TSTMICE Mouse                   ; Loop until left mouse pressed
  63.  
  64. ****************************************************************************
  65. ; Return operating system and go back to user
  66.  
  67.         FREE    Screen,10240            ; Free Memory
  68.  
  69.         HEAL                            ; Restore System
  70.         moveq.l    #0,D0                   ; No error
  71.         Rts                             ; Exit Program
  72.  
  73. ****************************************************************************
  74.  
  75. ; All copper list after here, executed 50 times a second.
  76.  
  77. Copper:
  78.         Spr_Off                 ; Switch sprites off
  79.         Cmove   $2881,Diwstrt   ; Display Window X + Y Start
  80.         Cmove   $28c1,Diwstop   ; Display Window X + Y Stop
  81.         Cmove   $38,Ddfstrt     ; Data Fetch Start
  82.         Cmove   $d0,Ddfstop     ; Data Fetch Stop
  83.         Cmove   $0,Bpl1mod      ; Odd Bitplane Modulo
  84.         Cmove   $0,Bpl2mod      ; Even Bitplane Modulo
  85.  
  86.         Cmove   $1200,Bplcon0   ; Bitplane Control Register
  87. plane1l Cmove   $0000,Bpl1ptl   ; Address Pointer Lower Word
  88. plane1h Cmove   $0000,Bpl1pth   ; Address Pointer Upper Word
  89.  
  90.         Cmove   $000,color00    ; $dff180 colour 0
  91.         Cmove   $000,color01    ; $dff182 colour 1
  92.  
  93.         dc.w    $8009,$fffe,$180,$330  ; Wait $YYXX,$Mask,Colour reg., colour
  94.         dc.w    $8109,$fffe,$180,$440  ; etc.
  95.         dc.w    $8209,$fffe,$180,$550
  96.         dc.w    $8309,$fffe,$180,$660
  97.         dc.w    $8409,$fffe,$180,$770
  98.         dc.w    $8509,$fffe,$180,$880
  99.         dc.w    $8609,$fffe,$180,$990
  100.         dc.w    $8709,$fffe,$180,$aa0
  101.         dc.w    $8809,$fffe,$180,$bb0
  102.         dc.w    $8909,$fffe,$180,$cc0
  103.         dc.w    $8a09,$fffe,$180,$dd0
  104.         dc.w    $8b09,$fffe,$180,$ee0
  105.         dc.w    $8c09,$fffe,$180,$ff0
  106.         dc.w    $8d09,$fffe,$180,$ee0
  107.         dc.w    $8e09,$fffe,$180,$dd0
  108.         dc.w    $8f09,$fffe,$180,$cc0
  109.         dc.w    $9009,$fffe,$180,$bb0
  110.         dc.w    $9109,$fffe,$180,$aa0
  111.         dc.w    $9209,$fffe,$180,$990
  112.         dc.w    $9309,$fffe,$180,$880
  113.         dc.w    $9409,$fffe,$180,$770
  114.         dc.w    $9509,$fffe,$180,$660
  115.         dc.w    $9609,$fffe,$180,$550
  116.         dc.w    $9709,$fffe,$180,$440
  117.         dc.w    $9809,$fffe,$180,$330
  118.         dc.w    $9909,$fffe,$180,$220
  119.  
  120.         dc.w    $9a09,$fffe,$180,$0    ; Restore to Black on last line.
  121.  
  122.         Endcop                         ; End of Out Copper list!!
  123.  
  124. ****************************************************************************
  125.  
  126. Screen: dc.l    0       ; Stores Screen Data Address
  127.         end
  128.  
  129.